package com.gitbl.webchat.web.webmessage;

import com.gitbl.webchat.message.RoomMessage;
import com.gitbl.webchat.message.User;

public class Convert {
    public static WebUser parse(User u){
        WebUser mu = new WebUser();
        mu.setNickname(u.getNickName());
        mu.setUsername(u.getUserName());
        return mu;
    }

    public static WebRoom parse(RoomMessage roomM) {
        WebRoom wr = new WebRoom();
        wr.setTitle(roomM.getTitle());
        wr.setId(roomM.getId());
        wr.setMember(roomM.getMember());
        wr.setOwner(roomM.getOwner());
        return wr;
    }
}
